/**
 * Copyright 2015 bingoogolapple
 * <p/>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p/>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p/>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cn.bingoogolapple.badgeview;

import ohos.agp.components.Component;
import ohos.agp.render.Canvas;
import ohos.app.Context;
import ohos.media.image.PixelMap;
import ohos.multimodalinput.event.TouchEvent;

/**
 * BGABadgeable 接口
 *
 * @since 2021-04-21
 */
public interface BGABadgeable {

    /**
     * onDraw
     *
     * @param component Component
     * @param canvas    Canvas
     */
    void onDraw(Component component, Canvas canvas);

    /**
     * 显示圆点徽章
     */
    void showCirclePointBadge();

    /**
     * 显示文字徽章
     *
     * @param badgeText
     */
    void showTextBadge(String badgeText);

    /**
     * 隐藏徽章
     */
    void hiddenBadge();

    /**
     * 显示图像徽章
     *
     * @param bitmap
     */
    void showDrawableBadge(PixelMap bitmap);

    /**
     * 调用父类的onTouchEvent方法
     *
     * @param event
     * @return boolean
     */
    boolean callSuperOnTouchEvent(TouchEvent event);

    /**
     * 拖动大于BGABadgeViewHelper.mMoveHiddenThreshold后抬起手指徽章消失的代理
     *
     * @param delegate
     */
    void setDragDismissDelegate(BGADragDismissDelegate delegate);

    /**
     * 是否显示徽章
     *
     * @return boolean
     */
    boolean isShowBadge();

    /**
     * 是否可拖动
     *
     * @return boolean
     */
    boolean isDraggable();

    /**
     * 是否正在拖动
     *
     * @return boolean
     */
    boolean isDragging();

    /**
     * BGABadgeViewHelper
     *
     * @return BGABadgeViewHelper
     */
    BGABadgeViewHelper getBadgeViewHelper();

    /**
     * getWidth
     *
     * @return int
     */
    int getWidth();

    /**
     * getHeight
     *
     * @return int
     */
    int getHeight();

    /**
     * invalidate
     */
    void invalidate();

    /**
     * getId
     *
     * @return int
     */
    int getId();

    /**
     * 返回当前Component 以此来获取组件当前的Rect信息
     *
     * @return Component
     */
    Component getComponentRect();

    /**
     * getContext
     *
     * @return Context
     */
    Context getContext();

    /**
     * 传递顶层的Component
     *
     * @param topComponent Component
     */
    void setComponent(Component topComponent);

    /**
     * 传递Canvas
     *
     * @param canvas Canvas
     */
    void setDrawTask(Canvas canvas);
}
